import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Chicharra here.
 * 
 * @author Andrés Cruz Santiago 
 * @version 13/11/13
 */
public class Chicharra extends Actor
{
    /**
     * Act - do whatever the Chicharra wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        Actor nuevo= this.getOneIntersectingObject(Chapulin.class);
        if(nuevo!=null)
        {
            ((Chapulin)nuevo).activaChicharra();

        }
        if(isTouching(Chapulin.class))
        {
            World mundo=this.getWorld();               
            mundo.removeObject(this);
        }
    }
}
